﻿using IM.Easy.Core.Services;
using IM.Easy.Entity.System;
using IM.Easy.Infrastructure.Query;
using IM.Easy.SystemServices.Dtos.User;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IM.Easy.SystemServices.IServices
{
    public interface IUserService : IAppServices<SysUser>
    {
        PageResponse<SysUser> GetList(UserQueryDto query, params long[] deptId);

        /// <summary>
        /// 添加系统用户
        /// </summary>
        /// <param name="userDto"></param>
        /// <returns></returns>
        UserResponseDto Create(UserCreateDto userDto);

        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <returns></returns>
        UserResponseDto GetUser(long id);

        /// <summary>
        /// 删除用户
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        bool Delete(params long[] ids);

        /// <summary>
        /// 修改用户信息
        /// </summary>
        /// <param name="userDto"></param>
        /// <returns></returns>
        bool Update(UserCreateDto userDto);

        /// <summary>
        /// 传入铭文密码，初始化密码
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        bool InitPassword(long userId, string password);

        /// <summary>
        /// 获取初始化密码---铭文密码
        /// </summary>
        /// <returns></returns>
        string GetInitPassword();

        /// <summary>
        /// 禁用用户
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        bool Disable(long userId);

        /// <summary>
        /// 启用用户
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        bool Enable(long userId);

        /// <summary>
        /// 通过名称判断用户是否存在
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="userName"></param>
        /// <returns></returns>
        bool IsDuplicateUserName(long userId, string userName);

        /// <summary>
        /// 通过名称判断用户是否存在-----新增时做判断
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        bool IsDuplicateUserName(string userName);

    }
}
